//
// Created by Administrator on 2022/1/10.
//

#include <stdio.h>

int main() {
    int a = 0;
    //左：代表的内存空间
    //右：存入空间的值
    a = 2;

    int *p = &a;
    *p = 2;
    //复制、拷贝value
    int b = *p;
    printf("a=%d\n", a);
    b = 1;
    printf("b=%d\n", b);
    printf("a=%d\n", a);
    *p = 100;
    printf("a=%d\n", a);
    printf("b=%d\n", b);
    //&a=p;//ERROR
    //*p + 1 = 3;//ERROR
    int array[4] = {0};
    int *pa = array;
    *pa = 2;
    //相当于array[1]
    *pa++ = 345;
    *(pa++) = 400;
    for (int i = 0; i < 4; ++i) {
        if (i == 3) {
            printf("%d", array[i]);
        } else {
            printf("%d,", array[i]);
        }
    }
    printf("\n");

    /*
     * left:storage
     * right:value
     */
    return 0;
}